﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Collections;
using System.Text.RegularExpressions;

namespace Examen2008Facturas
{
    public partial class IntroducirArticulos : Form
    {
        public IntroducirArticulos()
        {
            InitializeComponent();
        }

        public IntroducirArticulos(ref ArrayList articulos)
        {
            ArrayList listaArticulos = new ArrayList();
            listaArticulos = articulos;
            InitializeComponent();


        }

        private void btcancelar_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void IntroducirArticulos_Load(object sender, EventArgs e)
        {
        }

        private void btInsertar_Click(object sender, EventArgs e)
        {

            string expre = @"^\d{3}\-\d{2}$";

            if (Regex.Match(tbCodigo.Text, expre).Success)
            {
                MessageBox.Show("Expresion regular succes");
                epCodigo.SetError(tbCodigo, "");
            }
            else
            {
                epCodigo.SetError(tbCodigo, "Introduzca un código segun el formato");
            }
        }
    }
}
